package com.leyou.item.mapper;

import com.leyou.item.pojo.Spu;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

public interface SpuMapper extends Mapper<Spu> {

    @Update("update tb_spu set saleable = !saleable where id = #{spuId}")
    void isSaleableBySpuId(@Param("spuId") Long spuId);


    @Select("select saleable from tb_spu where id = #{spuId}")
    int querySaleableBySpuId(@Param("spuId") Long spuId);


    @Update("update tb_spu set valid = 0 where id = #{spuId}")
    int isDeleteBySpuId(Long spuId);

}
